only translate widget relative coordinates to window relative if the
authorTim Janik <timj@gtk.org>
Wed, 17 Feb 1999 23:31:34 +0000 (23:31 +0000)
committerTim Janik <timj@src.gnome.org>
Wed, 17 Feb 1999 23:31:34 +0000 (23:31 +0000)
Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>

        * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
        relative coordinates to window relative if the widget is not a toplevel
        (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
        for toplevels.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkwidget.c

index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 218c473ca7f4d0313896394aef0c1ffd2e5a0937..b106b2e9c4bc1f287373ef3c3a6e24565868563b 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 18 00:27:46 1999  Tim Janik  <timj@gtk.org>
+
+       * gtk/gtkwidget.c (gtk_widget_queue_clear_area): only translate widget
+       relative coordinates to window relative if the widget is not a toplevel
+       (i.e. it has ->parent != NULL), otherwise the area size gets screwed up
+       for toplevels.
+
 Tue Feb 16 14:25:44 CST 1999 Shawn T. Amundson <amundson@gtk.org>
 
        * INSTALL
index 9c3a5a7ccecfdf62c6861cf65128a54692f8592c..e725fb9dcddf6c485dac5ce3545b3902c2e2a2ba 100644 (file)
@@ -1852,27 +1852,30 @@ gtk_widget_queue_clear_area (GtkWidget *widget,
     }
   else
     {
-      gint wx, wy, wwidth, wheight;
-      /* Translate widget relative to window-relative */
-
-      gdk_window_get_position (widget->window, &wx, &wy);
-      x -= wx - widget->allocation.x;
-      y -= wy - widget->allocation.y;
-
-      gdk_window_get_size (widget->window, &wwidth, &wheight);
-
-      if (x < 0)
-       {
-         width += x;  x = 0;
-       }
-      if (y < 0)
+      if (widget->parent)
        {
-         height += y; y = 0;
+         gint wx, wy, wwidth, wheight;
+         /* Translate widget relative to window-relative */
+         
+         gdk_window_get_position (widget->window, &wx, &wy);
+         x -= wx - widget->allocation.x;
+         y -= wy - widget->allocation.y;
+         
+         gdk_window_get_size (widget->window, &wwidth, &wheight);
+         
+         if (x < 0)
+           {
+             width += x;  x = 0;
+           }
+         if (y < 0)
+           {
+             height += y; y = 0;
+           }
+         if (x + width > wwidth)
+           width = wwidth - x;
+         if (y + height > wheight)
+           height = wheight - y;
        }
-      if (x + width > wwidth)
-       width = wwidth - x;
-      if (y + height > wheight)
-       height = wheight - y;
 
       gtk_widget_queue_draw_data (widget, x, y, width, height, NULL);
     }